'''
作者：20183215董振龙
文件名称：第五课测试.py
时间：2020年3月28日11点58分
'''
train1 =("K243","济宁-济南","13:30","17:34","4:04")
train2 =("G112","济宁-青岛","15:12","17:08","1:56")
train3 =("K11","北京-连云港","16:44","23:50","7:06")
TRAIN =[train1,train2,train3]
tplt = "{0:^10}\t{1:^10}\t{2:^10}\t{3:^10}\t{4:^10}\t"
print("   车次\t    出发站-到达站\t 出发时间     到达时间\t   历时\t")
for i in range(3):
    print(tplt.format(TRAIN[i][0],TRAIN[i][1],TRAIN[i][2],TRAIN[i][3],TRAIN[i][4]))
j=3
while 1:
    if((input("是否进行更新："))=="是"):
        checi =input("车次为：")
        luxian =input("出发站-到达站为：")
        s_time =input("出发时间为：")
        e_time =input("到达时间为：")
        time =input("历时：")
        trainn =(checi,luxian,s_time,e_time,time)
        TRAIN.append(trainn)
        j=j+1
        print("   车次\t    出发站-到达站\t 出发时间     到达时间\t   历时\t")
        for k in range(j):
            print(tplt.format(TRAIN[k][0], TRAIN[k][1], TRAIN[k][2], TRAIN[k][3], TRAIN[k][4]))
